#ifndef MORPHOLOGYPALLET_HPP_INCLUDED
#define MORPHOLOGYPALLET_HPP_INCLUDED

#include <gtkmm.h>
#include <libglademm.h>
#include <string>
#include "image.h"
#include "externtypes.h"
#include "morphology.h"

enum SE_Type{
    PREDEFINED,
    FROMIMAGE
};

class MorphPallet{
    Gtk::Window *window;
    Gtk::ComboBox *elementtype_erosion;
    Gtk::FileChooserButton *elementimage_erosion;
    Gtk::SpinButton *centerxselector_erosion;
    Gtk::SpinButton *centeryselector_erosion;
    Gtk::ComboBox *predefinedtype_erosion;
    Gtk::SpinButton *sizexselector_erosion;
    Gtk::SpinButton *sizeyselector_erosion;
    Gtk::HScale *iterationsselector_erosion;

    Gtk::ComboBox *elementtype_dilation;
    Gtk::FileChooserButton *elementimage_dilation;
    Gtk::SpinButton *centerxselector_dilation;
    Gtk::SpinButton *centeryselector_dilation;
    Gtk::ComboBox *predefinedtype_dilation;
    Gtk::SpinButton *sizexselector_dilation;
    Gtk::SpinButton *sizeyselector_dilation;
    Gtk::HScale *iterationsselector_dilation;

    Gtk::ComboBox *elementtype_open;
    Gtk::FileChooserButton *elementimage_open;
    Gtk::SpinButton *centerxselector_open;
    Gtk::SpinButton *centeryselector_open;
    Gtk::ComboBox *predefinedtype_open;
    Gtk::SpinButton *sizexselector_open;
    Gtk::SpinButton *sizeyselector_open;

    Gtk::ComboBox *elementtype_close;
    Gtk::FileChooserButton *elementimage_close;
    Gtk::SpinButton *centerxselector_close;
    Gtk::SpinButton *centeryselector_close;
    Gtk::ComboBox *predefinedtype_close;
    Gtk::SpinButton *sizexselector_close;
    Gtk::SpinButton *sizeyselector_close;

    Gtk::SpinButton *prunningvaluebutton;




    SE_Type se_type[4];
    string imagepath[4];
    int centerx[4];
    int centery[4];
    StructuringElement::Shape predefinedshape[4];
    int sizex[4];
    int sizey[4];

    int prunningvalue;

    public:
    MorphPallet();

    Gtk::Window* getWindow();

    StructuringElement *se_erosion;
    StructuringElement *se_dilation;
    StructuringElement *se_open;
    StructuringElement *se_close;

    int iterations[2];

    void changeParams();
    void changeParams_2();
    void createStructElem();
    void deleteStructElem();

};


#endif // MORPHOLOGYPALLET_HPP_INCLUDED
